package day04_api_code.com.itheima.d5_jdk8_time;

import java.time.LocalDate;

public class Test1_LocalDate {
    public static void main(String[] args) {
        LocalDate ld = LocalDate.now();
        System.out.println("ld = " + ld);

        System.out.println("ld.getYear() = " + ld.getYear());
        System.out.println("ld.getMonthValue() = " + ld.getMonthValue());
        System.out.println("ld.getDayOfMonth() = " + ld.getDayOfMonth());
        System.out.println("ld.getDayOfYear() = " + ld.getDayOfYear());
        System.out.println("ld.getDayOfWeek().getValue() = " + ld.getDayOfWeek().getValue());

        System.out.println("ld.withYear(2009) = " + ld.withYear(2009));
        System.out.println("ld.withMonth(12) = " + ld.withMonth(12));

        System.out.println("ld.plusYears(2) = " + ld.plusYears(2));
        System.out.println("ld.plusMonths(12) = " + ld.plusMonths(12));

        System.out.println("ld.minusYears(2) = " + ld.minusYears(2));
        System.out.println("ld.minusMonths(2) = " + ld.minusMonths(2));
        LocalDate ld8 = LocalDate.of(2009, 12, 30);
        LocalDate ld9 = LocalDate.of(2009, 12, 31);
        System.out.println("ld8.equals(ld9) = " + ld8.equals(ld9));
        System.out.println("ld8.isAfter(ld9) = " + ld8.isAfter(ld9));
        System.out.println("ld8.isBefore(ld9) = " + ld8.isBefore(ld9));
    }
}
